/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author hancing
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import paramsVue from '/@/views/test/params.vue';

const { adminPath } = useGlobSetting();

export interface DpColumn extends BasicModel<DpColumn> {
  createTime?: string; // 创建时间
  updateTime?: string; // 更新时间
  deleteTime?: string; // 删除时间
  columnName?: string; // 列名
  columnKey?: string; // 列键
  isShow?: string; // 默认显示
  isSort?: string; // 可排序
  type?: string; // 列类型
  sort?: string; // 排序号
  isShowComment?: string; // is_show_comment
  comment?: string; // comment
}

export const dpColumnList = (params?: DpColumn | any) =>
  defHttp.get<DpColumn>({ url: adminPath + '/dp/column/dpColumn/list', params });

export const getZhibiaoList = (params?: DpColumn | any) =>
  defHttp.get<DpColumn>({ url: adminPath + '/dp/column/dpColumn/getZhibiaoList', params });

export const getZhibiaoOfColumnIndexList = (params?: DpColumn | any) =>
  defHttp.get<DpColumn>({ url: adminPath + '/dp/column/dpColumn/getZhibiaoOfColumnIndexList', params });


export const getZbListForSelectStock = (params?: DpColumn | any) =>
  defHttp.get<DpColumn>({ url: adminPath + '/dp/column/dpColumn/getZbListForSelectStock', params });

export const getZbOfName = (params?: any) => {
  var {zbName} = params;
  return defHttp.get<DpColumn>({ url: adminPath + '/dp/column/dpColumn/getZbOfName/'+zbName });
}


export const dpColumnListData = (params?: DpColumn | any) =>
  defHttp.post<Page<DpColumn>>({ url: adminPath + '/dp/column/dpColumn/listData', params });

export const dpColumnForm = (params?: DpColumn | any) =>
  defHttp.get<DpColumn>({ url: adminPath + '/dp/column/dpColumn/form', params });

export const dpColumnSave = (params?: any, data?: DpColumn | any) =>
  defHttp.postJson<DpColumn>({ url: adminPath + '/dp/column/dpColumn/save', params, data });

export const dpColumnDelete = (params?: DpColumn | any) =>
  defHttp.get<DpColumn>({ url: adminPath + '/dp/column/dpColumn/delete', params });
